package day06;

public class GetMaxOfArray {
    public static void main(String[] args) {
        int a = getMaxOfArray(10,100);
        System.out.println("最大值为:"+a);
    }
    public static int getMaxOfArray(int len,int max){
        int[] arr = new int[len];
        int b = arr[0];
        for (int i = 1; i < arr.length; i++) {
            arr[i] = (int)(Math.random()*(max+1));
            System.out.println(arr[i]);
            if (b < arr[i]) {
                b = arr[i];
            }
        }
        return b;
    }
}
